// 组织架构模块的请求接口
import axios from '@/utils/request'

/**
 * 获取部门列表接口
 * @returns promise
 */
export function getDepartmentList() {
  return axios({
    method: 'get',
    url: '/company/department'
  })
}

/**
 * 删除部门
 * @param {*} id 部门id
 * @returns
 */
export function delDepartment(id) {
  return axios({
    method: 'DELETE',
    url: '/company/department/' + id
  })
}

/**
 * 新增部门接口
 * @param {*} data
 * @returns
 */
export function addDepartment(data) {
  return axios({
    method: 'post',
    url: '/company/department',
    data
  })
}

/**
 * 获取部门详情
 * @param {*} id 部门id
 * @returns
 */
export function getDepartmentDetail(id) {
  return axios({
    method: 'get',
    url: '/company/department/' + id
  })
}

/**
 * 修改部门详情
 * @param {*} id 部门id
 * @returns
 */
export function editDepartment(data) {
  return axios({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}
